﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using App.Interface;
using App.Model;
using App.MVC.App_Start;
using App.MVC.Attributes;
using App.MVC.Extend;
using App.MVC.Models;
using log4net;
using Newtonsoft.Json;

namespace App.MVC.Controllers
{
    public class HomeController : BaseController
    {
        public IClass1 _Class1 { set; get; }
        [RunningLogAspect(MethodName = "首页")]
        [WriteFileExceptionAspect]
        public ActionResult Index()
        {
            //string str = ViewData["Trees"].ToString();
            //List<App_PowerTree> tt = JsonConvert.DeserializeObject<List<App_PowerTree>>(str);
            ViewBag.Test = "";
            var str = _Class1.GetMyBoHuiYiJian(SiteInfo.GetUserName());
            if (!string.IsNullOrWhiteSpace(str) && str.IndexOf(":") > 0)
            {
                var id = str.Split(':')[0];
                ViewBag.Test = str.Split(':')[1];

            }

            #region 记录日志
            //throw new Exception("测试");
            #endregion
            return View();
        }
        public ActionResult Webapitest()
        {

            return View();

        }


        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}